package agriculture.mapper;

import agriculture.bean.Category;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CategoryMapper {

    @Select("SELECT id, name, parent_id FROM category WHERE status = 1 AND parent_id IS NULL ORDER BY sort ASC")
    List<Category> selectAllCategories();
}